package org.spring.test.v2;

import static org.junit.Assert.*;

import org.junit.Test;
import org.spring.context.ApplicationContext;
import org.spring.context.support.ClassPathXmlApplicationContext;

public class ApplicationContextTestV2 {

	@Test
	public void testGetBeanProperty() {
		ApplicationContext context = new ClassPathXmlApplicationContext("petstore-v2.xml");
		PetStoreService petStore = (PetStoreService)context.getBean("petStore");
		assertNotNull(petStore.getAccountDao());
		assertNotNull(petStore.getItemDao());
		assertEquals(petStore.getOwner(), "liuxin");
		assertEquals(petStore.getVersion(), 2);
	}

}
